package com.ljf.framework.Async;

import com.ljf.framework.context.LjfContext;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * 说明：
 *
 * @Auther: lijinfeng
 * @Date: 2024/8/1
 */
public interface AsyncService {
    /**
     * 异步执行且有返回值
     *
     * @param asyncEvent         异步事件
     * @param threadPoolExecutor 执行线程池
     * @param <T>                返回值范型
     * @return
     */
    <T> AsyncResult<T> supplyAsync(AsyncEvent<T> asyncEvent, ThreadPoolExecutor threadPoolExecutor);

    /**
     * 异步执行无返回值
     *
     * @param asyncEvent         异步事件
     * @param threadPoolExecutor 执行线程池
     */
    void runAsync(AsyncEvent asyncEvent, ThreadPoolExecutor threadPoolExecutor);

}
